package com.health_predict_springboot.service;

import com.health_predict_springboot.pojo.HealthIndicator;

import java.util.List;
import java.util.Map;

public interface HealthIndicatorService {
    // 根据指标ID查询
    HealthIndicator getIndicatorById(Long indicatorId);
    
    // 根据用户ID查询指标列表
    List<HealthIndicator> getIndicatorsByUserId(Long userId);
    
    // 查询所有指标
    List<HealthIndicator> getAllIndicators();
    
    // 新增指标
    int addIndicator(HealthIndicator indicator);
    
    // 更新指标
    int updateIndicator(HealthIndicator indicator);
    
    // 删除指标
    int deleteIndicator(Long indicatorId);
    
    // 分页查询指标
    List<HealthIndicator> getIndicatorsByPage(Map<String, Object> params);
    
    // 查询指标总数
    int getIndicatorCount(Map<String, Object> params);
    
    // 根据用户ID和时间范围查询指标
    List<HealthIndicator> getIndicatorsByUserIdAndTimeRange(Map<String, Object> params);
    
    // 查询异常指标
    List<HealthIndicator> getAbnormalIndicators();
    
    // 计算BMI
    double calculateBMI(int height, double weight);
    
    // 判断指标是否异常
    int judgeAbnormal(HealthIndicator indicator);
}